package com.example.manager.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.manager.service.SysOperLogService;
import com.example.model.dto.system.SysOperLogDto;
import com.example.model.entity.system.SysOperLog;
import com.example.model.vo.common.Result;
import com.example.model.vo.common.ResultCodeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "日志管理")
@RestController
@RequestMapping(value = "/admin/system/sysOperLog")
public class SysOperLogController {

    @Autowired
    private SysOperLogService sysOperLogService;

    @ApiOperation(value = "分页查询日志")
    @PostMapping(value = "/findAllSysOperLog")
    @ApiImplicitParam(name = "token" ,value = "token值"  ,dataType = "String",paramType = "header")
    public Result findAllSysOperLog(@RequestBody SysOperLogDto sysOperLogDto)
    {
        Page<SysOperLog> allSysOperLog = sysOperLogService.findAllSysOperLog(sysOperLogDto);

        return Result.build(allSysOperLog, ResultCodeEnum.SUCCESS);
    }

}
